﻿Public Enum ETokenParcerStdType
    WhiteSpace = ETokenParcerType.WhiteSpace
    Delimeter = ETokenParcerType.Delimeter
End Enum

Public Enum ETokenParcerType
    WhiteSpace = 0
    Delimeter = 1
    Std = 2
End Enum

Public Interface ITokenFactory
    Function NewDesigner(strTextRaw_i As String, numPosBeg_i As Int32) As CTokenDesignerBase
    Function NewToken(strTextRaw_i As String, numPosBeg_i As Int32, numLength_i As UInt32, strTextParced_i As String) As CTokenBase
End Interface

Public MustInherit Class CTokenBase
    Public Overridable ReadOnly Property Id As Int32
        Get
            Throw New NotImplementedException()
            Return 0
        End Get
    End Property

    Public Overridable ReadOnly Property PosBeg As Int32
        Get
            Throw New NotImplementedException()
            Return 0
        End Get
    End Property

    Public Overridable ReadOnly Property Length As UInt32
        Get
            Throw New NotImplementedException()
            Return 0
        End Get
    End Property

    Public Overridable ReadOnly Property Text As String
        Get
            Throw New NotImplementedException()
            Return Nothing
        End Get
    End Property
End Class

Public Interface ITokenParcerTreeNode

    ReadOnly Property ChildEnum As NSCllG.IEnumerable(Of ITokenParcerTreeNode)

    ReadOnly Property MustOccureChild As Boolean

    ReadOnly Property MustOccureNext As Boolean

    ReadOnly Property NextEnum As NSCllG.IEnumerable(Of ITokenParcerTreeNode)

    ReadOnly Property ParcerType As ETokenParcerType

    ReadOnly Property TokenFactory As ITokenFactory

    Sub BegParce(strTextRaw_i As String, ByRef numPosCurr_io As Integer, ByRef numRank_o As Int32)

    Sub EndParce(strTextRaw_i As String, ByRef numPosCurr_io As Integer, ByRef objToken_o As CTokenBase)

End Interface

Public MustInherit Class CTokenParcerBase
    Implements ITokenParcerTreeNode

    Protected MustOverride Sub Impl_BegParce(strTextRaw_i As String, ByRef numPosCurr_io As Integer, ByRef numRank_o As Integer) Implements ITokenParcerTreeNode.BegParce

    Protected MustOverride ReadOnly Property Impl_ChildEnum As NSCllG.IEnumerable(Of ITokenParcerTreeNode) Implements ITokenParcerTreeNode.ChildEnum

    Protected MustOverride Sub Impl_EndParce(strTextRaw_i As String, ByRef numPosCurr_io As Integer, ByRef objToken_o As CTokenBase) Implements ITokenParcerTreeNode.EndParce

    Protected MustOverride ReadOnly Property Impl_MustOccureChild As Boolean Implements ITokenParcerTreeNode.MustOccureChild

    Protected MustOverride ReadOnly Property Impl_MustOccureNext As Boolean Implements ITokenParcerTreeNode.MustOccureNext

    Protected MustOverride ReadOnly Property Impl_NextEnum As NSCllG.IEnumerable(Of ITokenParcerTreeNode) Implements ITokenParcerTreeNode.NextEnum

    Public MustOverride ReadOnly Property ParcerType As ETokenParcerType Implements ITokenParcerTreeNode.ParcerType

    Protected MustOverride ReadOnly Property Impl_TokenFactory As ITokenFactory Implements ITokenParcerTreeNode.TokenFactory

End Class

Public MustInherit Class CTokenDesignerBase

    Public MustOverride Sub PartAdd(objPart_i As CTokenBase)

    Public MustOverride Function Assemble(objConnector_i As CTokenBase) As CTokenBase

End Class
